package lab02.Test06;

public class Ladder {
    //Ladder类具有类型double的上底、下底、高、面积属性，具有返回面积的功能
    //属性
    double top;
    double bottom;
    double height;
    public Ladder(double t,double b,double h )
    {top=t;bottom=b;height=h;}
    //行为
    double area(){return (top+bottom)*height/2.0;}

    public static void main(String[] args) { //main函数
        Ladder area1=new Ladder(3,5,6);//构造函数
        System.out.println("其面积是"+area1.area());
    }


}
